#!/bin/sh
########################################################################
# Begin krb5
#
# Description : MIT Kerberos Boot Script.
#
# Authors     : Armin K. <krejzi@email.com>
#
# Version     : BLFS SVN
#
# Notes       :
#
########################################################################

### BEGIN INIT INFO
# Provides:          krb5
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: MIT Kerberos KDC and Admin Server
# Description:       Starts, stops or restarts the MIT Kerberos KDC,
#                    Admin Server and Database Propagation Server.
# X-LFS-Provided-By: BLFS
### END INIT INFO

. /etc/rc.d/functions

case "${1}" in
   start)
      log_info_msg "Kerberos KDC krb5kdc başlatılıyor"
      start_daemon /usr/sbin/krb5kdc
      log_info_msg "Kerberos administrative server kadmind başlatılıyor"
      start_daemon /usr/sbin/kadmind
      log_info_msg "Kerberos database propagation server kpropd başlatılıyor"
      start_daemon /usr/sbin/kpropd -S
      evaluate_retval
      ;;

   stop)
      log_info_msg "Kerberos database propagation server kpropd durduruluyor"
      killproc /usr/sbin/kpropd
      log_info_msg "Kerberos administrative server kadmind durduruluyor"
      killproc /usr/sbin/kadmind
      log_info_msg "Kerberos KDC krb5kdc durduruluyor"
      killproc /usr/sbin/krb5kdc
      evaluate_retval
      ;;

   restart)
      ${0} stop
      sleep 1
      ${0} start
      ;;

   status)
      statusproc /usr/sbin/krb5kdc
      statusproc /usr/sbin/kadmind
      statusproc /usr/sbin/kpropd
      ;;
   baslat)
      log_info_msg "Kerberos KDC krb5kdc başlatılıyor"
      start_daemon /usr/sbin/krb5kdc
      log_info_msg "Kerberos administrative server kadmind başlatılıyor"
      start_daemon /usr/sbin/kadmind
      log_info_msg "Kerberos database propagation server kpropd başlatılıyor"
      start_daemon /usr/sbin/kpropd -S
      evaluate_retval
      ;;

   durdur)
      log_info_msg "Kerberos database propagation server kpropd durduruluyor"
      killproc /usr/sbin/kpropd
      log_info_msg "Kerberos administrative server kadmind durduruluyor"
      killproc /usr/sbin/kadmind
      log_info_msg "Kerberos KDC krb5kdc durduruluyor"
      killproc /usr/sbin/krb5kdc
      evaluate_retval
      ;;

   ybaslat)
      ${0} stop
      sleep 1
      ${0} start
      ;;

   durum)
      statusproc /usr/sbin/krb5kdc
      statusproc /usr/sbin/kadmind
      statusproc /usr/sbin/kpropd
      ;;

   *)
      echo "Kullanımı: ${0} {baslat|durdur|ybaslat|durum}"
      echo "Usage: ${0} {start|stop|restart|status}"
      exit 1
      ;;
esac

exit 0

# End krb5
